package com.loyal.loyalerp.humenresource.employee.util;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.loyal.loyalerp.humenresource.categoryDetail.mapper.Gy_ConfigDetailMapper;

@Component
public class NationJsonSerialize extends JsonSerializer<Integer> {
	
	@Autowired
	private Gy_ConfigDetailMapper configDetailMapper;

	@Override
	public void serialize(Integer value, JsonGenerator jg, SerializerProvider arg2)
			throws IOException, JsonProcessingException {
		
		jg.writeString(configDetailMapper.selectNameById(value));
		
		
	}

}
